﻿
@{
    var model = ViewData["GroupIdImage"] != null ? int.Parse(ViewData["GroupIdImage"].ToString()) : 0;
    }
@*<form id="ImageForm" method="POST" enctype="multipart/form-data" action="/Book/submitImage">*@
<table class="upImg">
    <tr>
        <th>
            Image:
        </th>
        <td align="right">
            @*<input type="button" id="btnAddImage" value="choose image" onclick="" />*@
            @*<input type="file" style="display: none;" id="pic" name="pic" onchange="ImageChange();" />*@
           @*<input type="file" name="pic"/>*@
           @* <a href="#" onclick="aa();">try this</a>
           <input type="submit" id="btnSubmitImage" value="submit" />*@
           <input type="hidden" id="PictureID" name="PictureID" value='@string.Format("{0}",model)' />
           <input type="button" value="InputImage" id="btnInputImage" onclick="OpenPopupChooseImage();" />
        </td>
    </tr>
    <tr>
        @*Image*@
        <td style="width: 100%;" colspan="2">
            <div class="DetailImg">
                @{
                    if(Model == 0)
                    {
                        <img src="../../Content/image/icon/NOIMAGE.jpg" />
                    }
                 }
                
                <img id='imgAppr' alt="" name='imgAppr' src='@string.Format("/Handlers/ImageHandler.ashx?groupid={0}", model)'/>
            </div>
        </td>
    </tr>
   
</table>
@*</form>*@
<script type="text/javascript">
//    function aa() {
//        $("#pic").click();
    //    }

    function OpenPopupChooseImage() {
        Book_Script.openPopupChooseImage();
    }
</script>
